home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / cug103 / roffglob < prev    next >
Text File  |  1985-03-10  |  3KB  |  98 lines

  1. /* 4 MAY 81 */
  2. #include "bdscio.h"
  3. #include "dio.h"
  4.  
  5. int     debug;
  6. int PAGESTOP;
  7.  
  8. #define STDERR        4
  9. /* send error messages to console while in DIO */
  10.  
  11. #define DEBUG        ( debug != 0 )
  12. #define HUGE        135    /* generally large number */
  13. #define PAGEWIDTH    80    /* see RM_DEF */
  14. #define    COMMAND        '.'    /* all commands starts with this */
  15. #define    CONSOLE        -5    /* one of output options */
  16. #define PRINTER     -4    /* another */
  17. #define FILE        -3    /* another */
  18. #define    UNKNOWN        -1    /* returned if doesn't recg. command */
  19. #define    NO_VAL        -32760    /* returned when no argument w/commad */
  20. #define WE_HAVE_A_WORD   1       /* returned by getwrd func. */
  21. #define    NO        0
  22. #define    YES        1
  23. #define UNDERLINE    '\137'
  24. #define    CR        0x0D
  25. #define BACKSPACE    '\b'
  26. #define NUMSIGN        '#'    /* for title strings */
  27. #define NEWLINE        '\n'
  28. #define TAB        '\t'
  29. #define BLANK        ' '
  30. #define SQUOTE        0x27    /* single quote */
  31. #define DQUOTE        0x22    /* double quote */
  32. #define PAGELEN        66
  33.  
  34. #define FI        1    /* fill lines */
  35. #define TI        2    /* temporary indent */
  36. #define BP        3    /* begin page  */
  37. #define BR        4    /* causes break */
  38. #define CE        5    /* center line(s) */
  39. #define IN        7    /* left indent */
  40. #define LS        8    /* line spacing */
  41. #define NF        9    /* no fill */
  42. #define PL        10    /* set page length */
  43. #define RM        11    /* set right margin */
  44. #define SP        12    /* add blank line(s) */
  45. #define UL        13    /* underline line(s) */
  46. #define FO        14    /* footer title */
  47. #define HE        15    /* header title */
  48. #define M1        16    /* top margin */
  49. #define M2        17    /* second top margin */
  50. #define M3        18    /* first bottom margin */
  51. #define M4        19    /* bottom-most margin       */
  52.  
  53.  
  54. int FILL;    /* set to YES or NO */
  55. int LSVAL;    /* line spacing value -> default will be 1 */
  56. int TIVAL;    /* temporary indent -> default  0 */
  57. int INVAL;    /* left indent -> default  0 */
  58. int RMVAL;    /* right margin -> default  PAGEWIDTH */
  59. int CEVAL;    /* set equal to number of lines to be centered    */
  60.         /* default is 0                                   */
  61. int ULVAL;    /* set equal to number of lines to be underlined */
  62. int SPVAL;    /* blank lines to be spaced down */
  63.  
  64.  
  65. int CURPAG;    /* current output page number; init = 0 */
  66. int NEWPAG;    /* next output page number; init = 1 */
  67. int LINENO;    /* next line to be printed; init = 0 */
  68. int PLVAL;    /* page length in lines; init=66 */
  69. int M1VAL;    /* margin before and including header */
  70. int M2VAL;    /* margin after header */
  71. int M3VAL;    /* margin after last text line */
  72. int M4VAL;    /* bottom margin, including footer */
  73. int BOTTOM;    /* last live line */
  74.  
  75. char HEADER[ MAXLINE ];    /*  header title */
  76. char FOOTER[ MAXLINE ];    /* footer title */
  77.  
  78.  
  79. /* defaults for global parameters */
  80.  
  81. #define FI_DEF        1
  82. #define    LS_DEF        1
  83. #define    IN_DEF        0
  84. #define    RM_DEF        80
  85. #define    TI_DEF        0
  86. #define    CE_DEF        0
  87. #define    UL_DEF        -1
  88. #define M1_DEF        2
  89. #define M2_DEF        2
  90. #define M3_DEF        2
  91. #define M4_DEF        2
  92.  
  93.  
  94. int DIR;    /* for "spreading" of lines    */
  95. int OUTWRDS;    /* no. words in outbuf; init = 0 */
  96. char OUTBUF [ MAXLINE*2 ];    /* lines to be filled collected here */
  97. s    */
  98. int OUTWRDS;    /* no. words in ou